<template>
<div>

</div>

</template>
<script>
import axios from "../plugins/axios";

export default {
 name:"user",
  data(){
    return{
      users:[
        {
          name:'chaoguan',
          email:'123456@qq.com',
          password:'123456'
        },
        {
          name: "guanli",
          email:'234567@qq.com',
          password: "234567"
        }

      ]

    }
  },
  created() {
    // 在 axios 请求中添加 withCredentials: true
    axios.get('http://localhost:8088/user/findAll', { withCredentials: true })
        .then(resp => {
          console.log('请求成功', resp.data);
          this.users = resp.data;
        })
        .catch(error => {
          console.error('请求失败', error);
        });
  }
}

</script>

<style scoped>

</style>